uiAttach(findUIComponent("ui_panel_tools"), findUIComponent("ui_toolbar"), UICGROUP_OTHER);
uiAttach(findUIComponent("toolselect_select"), findUIComponent("ui_panel_tools"), UICGROUP_TOOLS);
uiAttach(findUIComponent("toolselect_entityspawner"), findUIComponent("ui_panel_tools"), UICGROUP_TOOLS);
uiAttach(findUIComponent("toolselect_morph"), findUIComponent("ui_panel_tools"), UICGROUP_TOOLS);

uiAttach(findUIComponent("menuitem_load"), findUIComponent("ui_toolbar"), 0);
uiAttach(findUIComponent("menuitem_save"), findUIComponent("ui_toolbar"), 0);

uiAttach(findUIComponent("ui_listbox_resources"),findUIComponent("ui_panel_resourcelibrary"), UICGROUP_RESOURCE);
uiAttach(findUIComponent("ui_resource_back"),findUIComponent("ui_panel_resourcelibrary"), UICGROUP_RESOURCE);

uiAttach(findUIComponent("ui_close_entity_picker_panel"),findUIComponent("ui_panel_entity_picker"), UICGROUP_RESOURCE);

uiAttach(findUIComponent("ui_panel_inner_entity_picker"),findUIComponent("ui_panel_entity_picker"), UICGROUP_RESOURCE);

with(ui_defaults) 
{
    if (uiParent != uiOParent)
    {
        uiOParent = uiParent;
        uiParentXDiff = xstart - uiParent.xstart;
        uiParentYDiff = ystart - uiParent.ystart;
    }
    
    x = uiParent.x + (uiParentXDiff);
    y = uiParent.y + (uiParentYDiff);
}





